Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…tform into docker
  • Loading branch information
RmnRss committed Aug 14, 2020
2 parents 5ccf645 + 220ab0f commit beecfed
Show file tree
Hide file tree
Showing 56 changed files with 3,953 additions and 3,186 deletions.
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ module.exports = {
"@storybook/addon-knobs",
"@storybook/addon-links",
"@storybook/addon-docs",
"@storybook/addon-viewport",
],
};
48 changes: 46 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
# astroplant-platform
Repository of the astroplant community platform front-end
# AstroPlant Community Platform

Repository of the astroplant community platform. For more information about the platform and it's purpose, go to [astroplant.io](https://www.astroplant.io/).

## Structure

```bash

│ .storybook // storybook related files
│ api // the strapi project
│ components // the react components
| |
| └─── cards
| └─── forms
| └─── grids
| └─── inputs
| └─── layouts
| └─── stories // storybook's stories
| └─── ...
│ hocs // higher order components
│ pages // next.js pages
| providers // providers & context definitions
| public // public assets for the next.js front-end
| services // tools to access api's data
| styles // styling related files
| utils // helper function & hooks

```

## Technology Stack & Dependencies

The platform uses [Next.js](https://nextjs.org/) as a front-end framework and [Strapi](https://strapi.io/) as a back-end. It uses data & control endpoints from [astroplant's API](https://github.com/AstroPlant/astroplant-api) to control kits and display their data.

## Tools used

- [Storybook](https://storybook.js.org/) : for documentation, design system publication, extreme use case testing.
- [Formik](https://formik.org/) & [Yup](https://github.com/jquense/yup) : for forms creation & validation
- [Styled-Components](https://styled-components.com/) : for styling.
- [Leaflet](https://leafletjs.com/) : for map creation & interactions.
- [React-Markdown](https://github.com/rexxars/react-markdown) : for markdown to html rendering.
- [Chart.js](https://www.chartjs.org/): for charts creation & edition.
> /!\ May change in favor of [D3.js](https://d3js.org/).
## Contributors

- [RmnRss](https://github.com/rmnrss)
14 changes: 7 additions & 7 deletions api/api/article/config/functions/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ module.exports = {
// Searching for urls in the content.
const imgUrls = Array.from(
tempContent.matchAll(/!\[(.*?)\]\((.*?)\)/g),
(m) => ({ alt: m[1], url: m[2] })
m => ({ alt: m[1], url: m[2] })
);

const urls = Array.from(
tempContent.matchAll(/\[(.*?)\]\((.*?)\)/g),
(m) => ({ alt: m[1], url: m[2] })
);
const urls = Array.from(tempContent.matchAll(/\[(.*?)\]\((.*?)\)/g), m => ({
alt: m[1],
url: m[2]
}));

const allUrls = urls.concat(imgUrls);

Expand All @@ -30,13 +30,13 @@ module.exports = {
tempContent = tempContent.replace(link, obj.alt);
}

data.preview = tempContent.substring(0, 416) + "...";
data.preview = tempContent.substring(0, 136) + "...";
},

/***
* update the preview of an existing article
*/
async updatePreview(params, data) {
this.addPreview(data);
},
}
};
2 changes: 1 addition & 1 deletion api/api/article/models/article.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"preview": {
"type": "text",
"required": false,
"maxLength": 420,
"maxLength": 140,
"minLength": 1
},
"categories": {
Expand Down
9 changes: 7 additions & 2 deletions api/config/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
host: env("HOST", "0.0.0.0"),
port: env.int("PORT", 1337),
admin: {
auth: {
secret: env("ADMIN_JWT_SECRET")
}
}
});
Loading

0 comments on commit beecfed

Please sign in to comment.