- Latest
npm
andNode.js
are required- Debian:
sudo apt update; sudo apt install nodejs; sudo apt install npm;
- Debian:
- Run
npm install
to install all listed dependencies. For more details check package.json.
- To run this project, follow these steps inside
/server
. Create a.env
file. Populate it with information regarding database access and local machine hosting port, following the correct format. Here's an example:ReplacePORT=8080 DATABASE_URL=mysql://janedoe:mypassword@localhost:5432/mydb GOOGLE_API_KEY=... JWT_SECRET=... JWT_EXPIRATION=... ...
8080
with your desired hosting port (remember you may need elevated privileges if you'd like to use port 80).
Check the Prisma Docs for more information regarding connection URLs. - If you'd like to run the project as is, you can skip to the next step.
- Otherwise, if you'd like to change the database structure (not advised), you'll have to compile a new
prisma/scheme.prisma
file. More information here. Advance only when yourprisma/scheme.prisma
file is ready.
- Otherwise, if you'd like to change the database structure (not advised), you'll have to compile a new
- We've built Greenly's database in MySQL, which was then Introspected into a Prisma Data Model, allowing us to use the Prisma Client.
- As such, if you're using the provided
prisma/scheme.prisma
file or have already built your own valid file, runnpm install @prisma/client
- As such, if you're using the provided
- That's it! You're locked and loaded! Keep in mind: if you ever change your
.env
file, you'll have to regenerate the Prisma Client. This can be done in one of the following ways:- Rerunning
npm install @prisma/client
- Running
npx prisma generate
- Rerunning
- Backend server logic (express.js) can be run by moving into
/server
and executingnpm start
.- If you're looking for an easier development environment, run
npx nodemon
so that the server auto-reloads with changes and/or crashes.- SSL support can also be disabled by including the flag
--SSL=False
. If disabled, the server will stop enforcing SSL on all requests. Use only for development purposes, otherwise heavily discouraged. - You can also enable request logging to
stdout
by including the-l
or--request-logging
flag. - Additionally, use the
-m
or--database-monitoring
flag for debugging purposes, where all database operations will be explicit and logged tostdout
.
- SSL support can also be disabled by including the flag
- If you're looking for an easier development environment, run
- The Vue.js server (frontend) can be run by moving into
/client
and executingnpm run serve
.
- For all hashing purposes, this project uses bcrypt, a Blowfish-cipher-based cryptographic algorithm which has stood the test of time.
Greenly Team 🌿 2022