This website was written by Godmode from the Eden Server with inspiration from FFXIAH and Arcanus.
- Node.js
pm2
for deployment
- After installing Node make sure you are able to run npm commands in your shell.
- Copy the
example.env
as.env
in the root directory and fill in the appropriate credentials. - Run the
npm i
command on the shell in the root directory. - Run the
npm i
command on the shell in the /client directory.
- Build the project by performing
npm run build
in the root directory. - Then run
npm start
from the root directory.
- Run
npm run dev
in the root directory.
The 'client' React app is setup with its own ESLint and Prettier config, plus a VSCode workspace config which enables format on save and issue highlighting. For this to work properly, open the 'client' folder as your project in VSCode. Test this is working by creating an issue such as incorrect tab spacing (Prettier), or referencing state or props directly in JSX to trigger a 'use destructuring' prompt (ESLint). You should see squiggly lines in the code and be able to hover over this for more info and potential quick fix options. Saving the file will solve any automatically fixable issues.
Ideally the 'client' React app should be able to function on its own without at the API. Therefore it should handle its own dependencies in terms of node modules and any configuration. Please ensure that any npm packages required for 'client' are installed at the 'client' level and not at the root API level.
The front-end primarily uses Bootstrap v4.5^ alongside 'react-bootstrap' components. 'Semantic UI' is also used in some places.
Bootstrap theme customisation is setup and lives in 'index.scss', which is imported into 'index.js'.
Software:
- MariaDB: The database itself, take note of the password you set as it will be used to access it later!
- HeidiSQL: A good GUI to manage the database.
- Open HeidiSQL and click on "New" (bottom left) to create a new session.
- Use the password you set during the MariaDB installation.
- Once connected to the session, right click on your session to the left, click "Create new > Database" and name it
eden_web
.
- Select the newly created
eden_web
database on the left (it will get a green tick mark). - Navigate to "File > Run SQL file...", and then select every
.sql
file from thesql\tables
of this project, and click Open. - Once it's done running the SQL files, your tables will be setup, and you can see the result by hitting the Refresh button (or F5) in HeidiSQL.
In sql\queries\samples
you can find example SQL scripts for adding content to the website. Copy the ones you need to use from the sql\queries
folder, and modify them as you see fit.
Any new files within the sql\queries
folder are ignored by git, so you can make as many changes as you want to the scripts you have there.
The SQL scripts can be run in the same way as when you were setting up the tables and data:
- Select the
eden_web
database on the left (it will get a green tick mark). - Navigate to "File > Run SQL file...", and then select the
.sql
file(s) you want to run from thesql\queries
folder, and click Open. - Once it's done running the SQL file(s), you can see the result by hitting the Refresh button (or F5) in HeidiSQL.
MYSQLHOST=127.0.0.1
MYSQLUSER=<username>
MYSQLPASS=<password>
MYSQLDB=eden_web
MYSQLPORT=3306
Copyright (c) 2020 Eden Server
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.