Giter Club home page Giter Club logo

near.academy's Introduction

near.academy

These instructions are for people on the NEAR Foundation Education team (and aren't necessarily relevant for the general public).

How to get started

# 1. Download project
git clone [email protected]:NEAR-Edu/near.academy.git
cd near.academy

# 2. Create .env files
cp src/frontend/.env.example src/frontend/.env
cp src/api/.env.example src/api/.env

# 3. Edit the values in those .env files as appropriate. For example, you'll need to specify the location of your database, etc. If you're on the team responsible for maintaining the official near.academy production site, ask Ryan Walsh or Albert Peci (oceanByte) for the secrets. Do NOT set your local machine to connect to the remote production database!

# 4. Install dependencies for frontend and backend
yarn
# or if your computer uses ARM architecture:
npm i --target_arch=x64

# 5. Install Mongodb:
brew tap mongodb/brew
brew install [email protected]
brew services start mongodb/brew/mongodb-community

# 6. Use mongodump to download a "dump" (copy) of the production (remote) database to your local machine:
mongodump --uri "mongodb://usersname:[email protected]:27100/dbname" --out "/Users/some_username/code/mongodb_dumps_for_near.academy/dump/"

# 7. Rename the local "dump" of the database [so that when you "restore" (create) the database locally, there won't be as much confusion as if it had the same name as the remote production one]:
cd /Users/some_username/code/mongodb_dumps_for_near.academy/dump/
mv nearacademy NearAcademyLocal

# 8. Run mongorestore to convert the local "dump" files into a real, running local database:
cd ..
mongorestore --nsInclude "*.*"

# 8. Start development
yarn start

Deployments

https://dashboard.render.com/ hosts 2 projects, both of which are connected to and depend on this repo.

Pushing commits to main will automatically redeploy both the API and frontend projects.

Frontend

  • "static site" on Render
  • Build Command: cd src/frontend && yarn && yarn build
  • Publish directory: src/frontend/build
  • Branch: main
  • Environment > Environment Variables: manually added one at a time, no Secret Files

API

  • "web service" on Render
  • Environment > Secret Files > Filename > .env: [paste the .env contents]
  • Dockerfile Path: /src/api/Dockerfile
  • Docker Build Context Directory: /src/api/
  • Docker Command: (blank)
  • Health Check Path: (blank)
  • Branch: main

See also

near.academy's People

Contributors

amgando avatar anson-vandoren avatar encody avatar insurecar avatar iopezi avatar lifeanalysis avatar lopezi avatar maxvyr avatar mement0l avatar nazarotakoyi avatar nazarstolyar avatar oceanbyte avatar ostaoleh-dev avatar petarvujovic98 avatar ryancwalsh avatar serhii-hurhsal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.