Skip to content

greengeneers/emeraldchip

Repository files navigation

Emerald Chip

Emerald Chip brings about the shift that e-waste recycling has needed: to bring the process closer to the donors. The platform aims to remove knowledge and logistical barriers to this problem by educating donors and connecting them to proper e-waste processing outlets.

Team

Project Screenshots

Overview Tab Overview Tab Donations Tab Donations Tab Events Tab Events Tab Facilities Tab Facilities Tab Profile Modal Profile Modal Auth Login

Table of Contents

Getting Started

Before you can actually start building, you need to create a database and configure your server's environment variables to connect with it.

  • Create a database with a name of your choice.
  • In the server/ folder, copy the .env.template and name it .env.
  • Update the .env variables to match your Postgres database information (username, password, database name)
  • Replace the SESSION_SECRET value with your own random string. This is used to encrypt the cookie's userId value.
  • Your .env file should look something like this:
# Replace these variables with your Postgres server information
# These values are used by knexfile.js to connect to your postgres server
PG_HOST='127.0.0.1'
PG_PORT=5432
PG_USER='postgres'
PG_PASS='postgres'
PG_DB='emeraldchip'

# Replace session secret with your own random string!
# This is used by handleCookieSessions to hash your cookie data
SESSION_SECRET=''

# When you deploy your database on render, this string can be used to test SQL queries to the deployed database.
# Leave this value blank until you deploy your database.
PG_CONNECTION_STRING=''

# AWS S3 Bucket
AWS_ACCESS_KEY=''
AWS_SECRET_KEY=''
AWS_S3_REGION=''
AWS_S3_BUCKET_NAME=''

Use Docker Container

To simplify local development, you can use Docker to containerize the application. Follow the steps below to build and run the project using Docker and Docker Compose.

Prerequisites

Ensure you have the following installed:

Step 1: Build the Docker Image

From the root directory of the project, build the image:

docker build -t emeraldchip .

Note: -t emeraldchip tags the image for easier reference.

Step 2: Start Services with Docker Compose

Use docker-compose to start both the backend server and the database services:

docker-compose up

Step 3: Access the App

Once the containers are up and running, access the app at:

http://localhost:3000

(Default port may vary depending on the environment variables)

Build and Start Commands

From within the root directory, run the following commands to install dependencies and run the project locally:

# Build Command — install dependencies, build the static assets, and run migrations/seeds
cd frontend && npm i && npm run build && cd ../server && npm i && npm run migrate && npm run seed && cd ..

# Start Command
cd server && npm start

Technologies Used

Frontend

  • ReactJS
  • JS, CSS, HTML

Backend

  • NodeJS
  • ExpressJS
  • KnexJS
  • PostgresQL

Infrastructure

Third-party API

  • Google Gemini API
  • AWS S3
  • AWS RDS

Project Proposal

See PROPOSAL.md for more details on the project proposal.

Contributing

See CONTRIBUTING.md for contribution guidelines.

Style Guide

This project adheres to the Airbnb Style Guide.

About

Turn tech waste into emerald treasures.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages