Documentation
  • Welcome
  • 🚀Getting Started
    • Introduction to AstroPlant
  • 🌱AstroPlant Kit Setup
    • Welcome to the setup guide
    • Designing your project
    • Operation & safety
    • Building the Maker Kit
      • Electronics assembly [Maker Edition]
      • Electronics assembly from scratch
      • Casing assembly v5.2
      • Extension shield connection mapping
    • AstroPlant software
      • Kit software setup
      • Building your kit software from scratch
      • Updating your kit software
      • Changelog
    • Registering and configuring a kit
    • AstroPlant Growth Protocol
    • Resources
    • Setup FAQ
  • ⌨️ Developers
    • Become a space dev!
      • AstroPlant Ecosystem
      • Data Concepts and Terminology
      • Software Architecture
      • GitHub Repositories
    • Core API
      • Getting Started
      • API Models
      • Live Feeds (WebSockets)
    • Community Platform
      • Architectural Decisions
      • Documentation
        • Project Structure
        • Front-End
        • Back-End
      • Development Setup
      • Roadmap
    • Software Customization
      • Use cases
    • Developers FAQ
  • 📚Resources
    • Contributing
Powered by GitBook
On this page
  • Using Docker Compose
  • Without Docker
  • Back-End
  • Front-End

Was this helpful?

  1. ⌨️ Developers
  2. Community Platform

Development Setup

Guide to setup the development environment for the Community Platform

PreviousBack-EndNextRoadmap

Last updated 4 years ago

Was this helpful?

Using Docker Compose

Make sure you have the and installed first, then run the following commands :

# Clone the repo
git clone https://github.com/AstroPlant/community-platform

cd community-platform

# Start up both strapi and next
docker-compose up -d

Once it's finished you should be asked to create a strapi admin account on localhost:1337. Please create at least an article, a user and add the correct permissions by following the steps . Then you should be able to access the front end on your localhost:3000.

Without Docker

Back-End

1. Set up environment variables

First, generate a secure token.

openssl rand 64 | base64 # (linux/macOS users)
# or
node -e "console.log(require('crypto').randomBytes(64).toString('base64'))" # (all users)

Create an env.local file at the root of this folder with the following content :

ADMIN_JWT_SECRET=token_generated_above

2. Setup a Postgres database

2. Create a database & a user

# Activating PSQL
psql postgres

# Create the strapi db
CREATE DATABASE strapi;

# Create a user
CREATE ROLE strapi WITH LOGIN PASSWORD 'strapi' CREATEDB;

# Grant all priviledge to the strapi user
GRANT ALL PRIVILEGES ON DATABASE strapi TO strapi;

3. Install Strapi

From then you should be able to install and launch our strapi app with the following commands :

# Clone the repo
git clone https://github.com/AstroPlant/community-platform

cd community-platform/api

# install strapi dependencies
npm install

# Start up strapi
npm run develop

When Strapi is installed you should be asked to create a Strapi admin account on your localhost:1337.

Front-End

Create env files

Create an env.local file at the root of the project with the following content :

NEXT_PUBLIC_STRAPI_PUBLIC_URL="http://localhost:1337"
NEXT_PUBLIC_STRAPI_CLUSTER_URL="http://localhost:1337"

Install the package

Run the following commands :

# Clone the repo
git clone https://github.com/AstroPlant/community-platform

cd community-platform/api

# install strapi dependencies
npm install

# Start up strapi
npm run develop

When strapi is installed you should be asked to create a strapi admin account on your localhost:1337.

Then you should be able to install and boot next on localhost:3000.

cd ..

# install next dependencies
npm install

# Start up strapi
npm run dev

Install .

Please follow the steps presented on the to install Postgres.

git command-line tool
Docker
here
PostgreSQL
PostgreSQL website