Git Product home page Git Product logo

erdesarrollo's Introduction

Getting Started

Table of contents

Folder structure

Our app follows the basic structure: Note: CamelCase convention must be used for directory names as components, pages, layout, providers

/your/app/root/
`-- src
    |-- app
        |-- [lang]
            |-- home/
            |-- about/
            |-- contact/
   |-- components/
        |-- Footer/
        |-- Navbar/
   |-- utils
        |-- hooks/
        |-- constants/
        |-- function/
        |-- typing/
    |-- Layouts/

How to create a new Page

Index routes The router will automatically route files named index to the root of the directory.

[index] app/pages.js โ†’ / [some_url] page/blog/page.js โ†’ /blog

App with Dynamic Routes Next.js supports pages with dynamic routes. For example, if you create a file called pages/posts/[id].js, then it will be accessible at posts/1, posts/2, etc. This is a next project please consider it will need a server running to be able

Next Doc (https://nextjs.org/docs/app/building-your-application/routing/defining-routes)

3. Creating a new PR in Github

When developing one good practice is to start by opening a draft PR so the team can keep up with what you're doing from the start, but that's not strictly necessary.

When opening a PR you should name it following the template

[ANW30-XXX]: <ticket description>

And do not ignore the PR description template, please fill it out as better as you can, this helps everyone who's reviewing and can help you remember things you're leaving behind. Also, assign the PR to yourself so we can easily track it.

When you're finished, open the PR for review. This does not mean the PR is ready to merge, only that you feel like you're done, so do not fret about only opening the PR when you think it's a masterpiece

Please, auto review your own PR before opening it up!

Basic recommended configurations

This configuration assumes that you're using Chrome, if not just change the type property to whichever you like.

Extensions

This is a list of recommend extensions and some VSCode configs to help ease the Developer Experience. Some of these we recommend more fiercely because you'll be using them very frequently. These will be suffixed with *.

  • Prettier - Code formatter *
  • ESLint *
  • Live Share (this is nice to have if you're working more commonly in pair programming)
  • Auto Rename Tag
  • Toggle Quotes
  • ES7 + React/Redux/React-Native snippets

Relevant links

Running backend locally

  1. Clone the backend repository locally:
  git clone https://github.com/a1repo/a1_web_3.0_strapi_cms.git
  1. Next, Set up your .env file. You can use the .env.example file as reference:
HOST=localhost
PORT=1337
APP_KEYS="toBeModified1,toBeModified2"
API_TOKEN_SALT=tobemodified
ADMIN_JWT_SECRET=tobemodified
JWT_SECRET=tobemodified
TRANSFER_TOKEN_SALT=tobemodified
  1. Start the backend project by running the following command:
  npm run build
  npm run develop

You will be prompted to create your first admin user.

admin-user

Great. You now have your project running. Let's add some data.

Seeding The Data

We are going to use our DEITS feature which will alow to easily import data into your project.

You can learn more about it in our documentation here.

In the root of our project we have our seed-data.tar.gz file. We will use it to seed our data.

  1. Open up your terminal and make in the backend folder.

  2. Run the following command to seed your data:

  npm run strapi import -f ./seed-data.tar.gz

after-import

This will import your data locally. Log back into your admin panel to see the newly imported data.

Here is a quick video covering initial setup and data seeding.

seed-data-demo.mp4

Setting Up The Frontend

Next we need to create our .env file and paste in the following.

NEXT_PUBLIC_STRAPI_API_TOKEN=your-api-token
NEXT_PUBLIC_PAGE_LIMIT=6
NEXT_PUBLIC_STRAPI_FORM_SUBMISSION_TOKEN=your-form-submission-token
NEXT_PUBLIC_STRAPI_API_URL=http://localhost:1337

erdesarrollo's People

Contributors

iocevelasco avatar

Watchers

 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.