- Latest
npmandNode.jsare required- Debian:
sudo apt update; sudo apt install nodejs; sudo apt install npm;
- Debian:
- Run
npm installto install all listed dependencies. For more details check package.json.
- To run this project, follow these steps inside
/server. Create a.envfile. 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=... ...8080with 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.prismafile. More information here. Advance only when yourprisma/scheme.prismafile 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.prismafile 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
.envfile, 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
/serverand executingnpm start.- If you're looking for an easier development environment, run
npx nodemonso 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
stdoutby including the-lor--request-loggingflag. - Additionally, use the
-mor--database-monitoringflag 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
/clientand 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